﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using egypt.Logic;
using egypt.Logic.Data;

namespace egypt.Web.Admin
{
    public partial class AddCountry : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            //保存图片
            if (fu_img.HasFile)
            {
                string imgPath = "../images/" + fu_img.FileName;
                fu_img.SaveAs(Server.MapPath(imgPath));
                country c = country.GetInstance(0, this.txt_country.Text, imgPath, this.cb_isShow.Checked);
                DataAdapter da = new DataAdapter(System.Configuration.ConfigurationManager.ConnectionStrings["egypt"].ConnectionString);
                da.AddCountry(c);

                
            }

        }
    }
}
